import request from './request'

//分类创建
export function putCategoryCreate(data) {
  return request({
    url: '/rest/categories',
    method: 'post',
    data
  })
}

// 分类列表
export function getCategoryList(params) {
  return request({
    url: '/rest/categories',
    method: 'get',
    params
  })
}

// 获取分类编辑数据
export function getCategoryEditDetail(id) {
  return request({
    url: `/rest/categories/${id}`,
    method: 'get',
  })
}

// 分类编辑
export function putCategoryEdit(id,data) {
  return request({
    url: `/rest/categories/${id}`,
    method: 'put',
    data
  })
}

// 分类列表删除
export function deleteCategoryList(id) {
  return request({
    url: `/rest/categories/${id}`,
    method: 'delete',
  })
}